<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Component Test</title>
</head>
<body>
    <div id="app-7">
        <ol>
            <todo-item
            v-for="item in groceryList"
            v-bind:todo="item"
            >
            </todo-item>
        </ol>
    </div>
    <div id="app">
        <p>{{ foo }}</p>
        <!-- 这里的foo不会更新 -->
        <button v-on:click="foo = 'baz'">Change it</button>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.14"></script>
    <script>
        Vue.component("todo-item", {
            props: ["todo"],
            template: "<li>{{ todo.text }}</li>"
        });
        var app7 = new Vue({
            el: "#app-7",
            data: {
                groceryList: [
                    {text: "蔬菜"},
                    {text: "奶酪"},
                    {text: "随便其他什么人吃的东西"}
                ]
            }
        });
        var obj = {
            foo: 'bar'
        }
        Object.freeze(obj)
        new Vue({
            el: "#app",
            data: obj
        })
    </script>
</body>
</html>